﻿#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include "CIEChromaticityPlot.h"

class QTabWidget;
class QAction;

class MainWindow : public QMainWindow
{
    Q_OBJECT
public:
    explicit MainWindow(QWidget *parent = nullptr);

private:
    void buildUi();
    void loadCmfOrAsk();
    void applyTogglesToAll();

private slots:
    void onToggleSRGB(bool on);
    void onToggleAdobe(bool on);
    void onTogglePlanck(bool on);
    void onToggleIsoCCT(bool on);
    void onToggleDomWL(bool on);
    void onTabChanged(int idx);

private:
    QTabWidget *tabs_ = nullptr;

    CIEChromaticityPlot *plot1931_ = nullptr;
    CIEChromaticityPlot *plot1976_ = nullptr;
    CIEChromaticityPlot *plot2015_ = nullptr;

    QAction *actSRGB_   = nullptr;
    QAction *actAdobe_  = nullptr;
    QAction *actPlanck_ = nullptr;
    QAction *actIsoCCT_ = nullptr;
    QAction *actDomWL_  = nullptr;

    bool cmf1931Ok_ = false;
    bool cmf2015Ok_ = false;
};

#endif // MAINWINDOW_H
